<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增学生</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="container mt-5">
    <h2 class="mb-4">新增学生信息</h2>

    <!-- 表单提交到 /student/add -->
    <form th:action="@{/student/add}" method="post" class="w-50">
        <div class="mb-3">
            <label for="studentId" class="form-label">学号</label>
            <input type="text" class="form-control" id="studentId" name="studentId" required>
        </div>
        <div class="mb-3">
            <label for="name" class="form-label">姓名</label>
            <input type="text" class="form-control" id="name" name="name" required>
        </div>
        <div class="mb-3">
            <label for="age" class="form-label">年龄</label>
            <input type="number" class="form-control" id="age" name="age" min="1" max="100" required>
        </div>
        <div class="mb-3">
            <label class="form-label">性别</label>
            <div>
                <input type="radio" id="male" name="gender" value="男" checked>
                <label for="male" class="me-3">男</label>
                <input type="radio" id="female" name="gender" value="女">
                <label for="female">女</label>
            </div>
        </div>
        <button type="submit" class="btn btn-primary">提交</button>
        <a href="/student/list" class="btn btn-secondary ms-2">返回</a>
    </form>
</body>
</html>